//
//  SMHFriendHeadView.swift
//  SMHCommerce
//
//  Created by lvzhao on 2020/6/6.
//  Copyright © 2020 lvzhao. All rights reserved.
//

import UIKit

class SMHFriendHeadView: LZBaseView {

    var viewModel = SMHFriendViewModel()
    override init(viewModel: LZBaseViewModel) {
        super.init(viewModel: viewModel)
        self.viewModel = viewModel as! SMHFriendViewModel
        
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //MARK:SETUPUI
    func setupUI()  {
        
        //代理人:
        let agentLab = UILabel()
        agentLab.font = ktextFont(size: 14)
        agentLab.textColor = UIColorFromHex(rgbValue: 0xA8A8A8)
        agentLab.text = "代理人:"
        addSubview(agentLab)
        agentLab.snp.makeConstraints { (make) in
            make.left.equalTo(15)
            make.top.equalTo(15)
            make.height.equalTo(15)
            make.width.equalTo(55)
        }
        
        //代理人姓名:
        let agentNameLab = UILabel()
        agentNameLab.font = ktextFont(size: 14)
        agentNameLab.textColor = UIColorFromHex(rgbValue: 0x363636)
        addSubview(agentNameLab)
        agentNameLab.snp.makeConstraints { (make) in
            make.left.equalTo(agentLab.snp.right).offset(5)
            make.centerY.equalTo(agentLab)
            make.height.equalTo(15)
            make.width.equalTo(kScreenWidth - 90)
        }
        
        
        //电话
        let phoneLab = UILabel()
        phoneLab.font = ktextFont(size: 14)
        phoneLab.textColor = UIColorFromHex(rgbValue: 0xA8A8A8)
        phoneLab.text = "电    话:"
        addSubview(phoneLab)
        phoneLab.snp.makeConstraints { (make) in
            make.left.equalTo(agentLab)
            make.top.equalTo(agentLab.snp.bottom).offset(5)
            make.height.equalTo(15)
            make.width.equalTo(55)
        }
        
        
        
        let phoneNumLab = UILabel()
        phoneNumLab.font = ktextFont(size: 14)
        phoneNumLab.textColor = UIColorFromHex(rgbValue: 0x363636)
        addSubview(phoneNumLab)
        phoneNumLab.snp.makeConstraints { (make) in
            make.left.equalTo(phoneLab)
            make.centerY.equalTo(phoneLab)
            make.height.equalTo(15)
            make.width.equalTo(agentNameLab)
        }

        
        //微信
        let wechatLab = UILabel()
        wechatLab.font = ktextFont(size: 14)
        wechatLab.textColor = UIColorFromHex(rgbValue: 0xA8A8A8)
        wechatLab.text = "微    信:"
        addSubview(wechatLab)
        wechatLab.snp.makeConstraints { (make) in
            make.left.equalTo(phoneLab)
            make.top.equalTo(phoneLab.snp.bottom).offset(5)
            make.height.equalTo(15)
            make.width.equalTo(55)
        }
          
          
          
        let wechatNumLab = UILabel()
        wechatNumLab.font = ktextFont(size: 14)
        wechatNumLab.textColor = UIColorFromHex(rgbValue: 0x363636)
        addSubview(wechatNumLab)
        wechatNumLab.snp.makeConstraints { (make) in
            make.left.equalTo(wechatLab.snp.right).offset(5)
            make.centerY.equalTo(wechatLab)
            make.height.equalTo(15)
            make.width.equalTo(agentNameLab)
        }
        
        
        let lineBottomView = UIView()
        lineBottomView.backgroundColor = ColorBackGround
        addSubview(lineBottomView)
        lineBottomView.snp.makeConstraints { (make) in
            make.left.equalTo(0)
            make.bottom.equalTo(0)
            make.width.equalTo(kScreenWidth)
            make.height.equalTo(10)
        }
        
        
   
        
    }
    
    
    /**
        [self.viewModel.reloadSubject subscribeNext:^(id  _Nullable x) {
            agentNameLab.text = self.viewModel.friendModel.userName?:@"";
            phoneNumLab.text = self.viewModel.friendModel.mobile?:@"";
            wechatNumLab.text = self.viewModel.friendModel.wechat?:@"";

        }];

     */

}
